﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO.Ports;
using System.ComponentModel;

using Atosenet.PluginEngine;


namespace Atosenet.IO
{
    [PluginAttribute("Atosenet", "Atosenet.IO.UdpServerIOParameter", "UDP服务端配置", PluginType.IOParameter)]
    public class UdpServerIOParameter : IOParameter
    {
        #region 成员

        public new const string CATEGORY_NAME = "UDP服务端设置";
        public static UdpServerIOParameter Default = new UdpServerIOParameter(2012);

        private int _localPort = 2012;        

        #endregion


        #region 初始化

        public UdpServerIOParameter()
            : this(2012)
        { }

        public UdpServerIOParameter(int listeningPort)
        {
            _localPort = listeningPort;
        }

        #endregion


        #region 属性

        [CategoryAttribute(CATEGORY_NAME)]
        [DescriptionAttribute("本地监听端口")]
        public int ListeningPort
        {
            get { return _localPort; }
            set
            {
                if (_localPort != value)
                {
                    _localPort = value;
                    OnParameterChanged();
                }
            }
        }

        [DescriptionAttribute("IO名称")]
        public override string IOName
        {
            get { return "UDP服务端连接"; }
        }

        #endregion
    }
}
